package com.mz.mattress.admin.api.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mz.mattress.admin.api.req.PlanDateQueryReq;
import com.mz.mattress.admin.service.PlanTaskDataService;
import com.mz.mattress.api.common.Constants;
import com.mz.mattress.api.common.Result;
import com.mz.mattress.api.entity.PlanTaskData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping(Constants.ADMIN_PATH + "planTaskData")
public class PlanTaskDataController {

    @Autowired
    private PlanTaskDataService planTaskDataService;

    @GetMapping("/listPage")
    public Result<IPage<PlanTaskData>> listPage(PlanDateQueryReq req) {
        return planTaskDataService.listPage(req);
    }

    @GetMapping("/{id}")
    public Result<PlanTaskData> detail(@PathVariable Integer id) {
        return planTaskDataService.getById(id);
    }

}
